# 02-加减乘除.py
# 1、加
def a(x,y):
    return x+y;
# 2、减
def b(x,y):
    return x-y;
# 3、乘
def c(x,y):
    return x*y;
# 4、除
def c(x,y):
    if y==0:
        print('除数不能为0')
    else:
        return x/y
    
def main():
    index = input('请输入1、加 2、减 3、乘 4、除:')
    sums = 0
    if index in ['1','2','3','4']:
        num1 = float(input('请输入第一个数：'))
        num2 = float(input('请输入第二个数：'))
        if index=='1':sums =a(num1,num2)
        if index=='2':sums =b(num1,num2)
        print("运算结果为：",sums)
    else:
        print('输入错误！')
        
main()